Skip to content

Overhaul test infrastructure#389

Open
lkdvos wants to merge 39 commits intomainfrom
ld-testing
Open

Overhaul test infrastructure#389
lkdvos wants to merge 39 commits intomainfrom
ld-testing

Conversation

@lkdvos
Copy link
Copy Markdown
Member

@lkdvos lkdvos commented Mar 24, 2026

Summary

  • Moves test dependencies into a dedicated test/Project.toml, separating them from the main package manifest
  • Replaces the monolithic test runner with ParallelTestRunner.jl, running each test file in its own worker process
  • Adds --fast mode that skips AD test groups and reduces sector/scalar-type coverage for quick iteration
  • Adds test/README.md documenting how to run tests, available groups, fast mode, and how to add new test files
  • Updates CI to auto-discover test groups as matrix jobs; draft PRs run a reduced matrix (ubuntu + Julia 1 only) while ready PRs run the full matrix

kshyatt
kshyatt previously approved these changes Mar 25, 2026
Copy link
Copy Markdown
Member

@kshyatt kshyatt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apart from minor comment LGTM, this will be very helpful for the Enzyme PR

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 25, 2026

Your PR no longer requires formatting changes. Thank you for your contribution!

@kshyatt
Copy link
Copy Markdown
Member

kshyatt commented Mar 26, 2026

Ope, GPU failures look related...

@kshyatt kshyatt self-requested a review March 26, 2026 09:58
@lkdvos
Copy link
Copy Markdown
Member Author

lkdvos commented Mar 26, 2026

Needs #390 first, but should then be ready.

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 26, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

Files with missing lines Coverage Δ
ext/TensorKitChainRulesCoreExt/linalg.jl 100.00% <100.00%> (ø)
src/fusiontrees/braiding_manipulations.jl 95.34% <100.00%> (+7.64%) ⬆️
src/spaces/productspace.jl 88.46% <100.00%> (-0.15%) ⬇️

... and 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@lkdvos lkdvos marked this pull request as ready for review March 27, 2026 13:23
@lkdvos lkdvos force-pushed the ld-testing branch 2 times, most recently from ab125b5 to e3ce090 Compare March 30, 2026 12:56
return (Vtr, Vℤ₃, VU₁, VfU₁, VCU₁, VSU₂, VfSU₂, VIB_diag, VIB_M)
end

# Gauge-fixing tangents for AD factorization tests
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clearly we should have these functions in the main MAK module?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is in line with the current MAK approach. I'm happy to migrate this, but probably we should then also do this for MAK itself so we can reuse the functions.

@Jutho
Copy link
Copy Markdown
Member

Jutho commented Mar 30, 2026

This generally looks good; I left a few small comments and questions. But clearly, this is too much change for a detailed review. Is there a convenient way to review such code reorganization, i.e. to separate between what has just moved to other files and what are actual changes. I could probably ask some agent, but I don't feel like doing that.

@lkdvos
Copy link
Copy Markdown
Member Author

lkdvos commented Mar 30, 2026

I don't think there is, but I did try and not actually alter anything except for the organization of the tests.
To summarize:

  • Split files over separate files/folders to have some parallelization
  • Reworked the github actions implementation
  • added a --fast filter that just reduces some of the tests

In principle there is no reason to review the actual contents of the test files, since these are unchanged, which also explains some of the things you commented on.
I'll address those in the meantime.

@Jutho
Copy link
Copy Markdown
Member

Jutho commented Apr 4, 2026

Ok, this took longer than anticipated, but locally all tests are passing. This does not include CUDA, so that can definitely still fail, or other Julia versions. I also had to disable some things such as chainrules for svd_full (that will be one of my next priorities in MAK), but strangely enough also all svd chainrules for adjointtensormap.

@Jutho
Copy link
Copy Markdown
Member

Jutho commented Apr 5, 2026

Ok, I think I made the changes that I wanted here. I also synchronized the CUDA tests to be more in line with the CPU tensor and factorization tests in terms of tensors (with a little help from my friends :copilot: ) . However, even after increasing the buildkite workflow to a 90 minute limit, they seem to time out (which is strange; these are not AD tests, the corresponding CPU tests take about 10 minutes).

However, without being able to run these locally, nor seeing the detailed progress report, this is very hard to debug. Do you know how to get more details out of logs of the aborted buildkite runs @kshyatt ? Or do you want to take a look.

If we do not want to special case the multifusion cases, the only tensors that are valid are:

"square" tensors (same domain or codomain), where the domain is either V1, V1 * V2, V1 * V2 * V3, ... (in sequential order)

or

"rectangular" tensors which are some "cyclic" permutations (i.e. transpositions) of V1 * V2 * V3 * V4 * V5 (all 5 are necessary).

So things like V1 * V2 * V3 ← (V4 * V5)' .

@kshyatt
Copy link
Copy Markdown
Member

kshyatt commented Apr 5, 2026 via email


# Sector utility
# --------------
smallset(::Type{I}) where {I <: Sector} = take(values(I), 5)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to import the TensorKitSectors testsuite to have the same helper functions, or just manually carry them over here? Either way, I think it's useful to be using the same smallsets.

@kshyatt
Copy link
Copy Markdown
Member

kshyatt commented Apr 6, 2026

I was able to run the CUDA tests locally, I'll try to fix them tomorrow. Here are the outputs:

                          │   Test   │ ──────────────── CPU ──────────────── │                                                                                                                             
Test             (Worker) │ time (s) │ GC (s) │ GC % │ Alloc (MB) │ RSS (MB) │                                                                                                                             
cuda/factorizations   (2) │  3101.58 │   failed at 2026-04-06T10:44:14.812                                                                                                                                 
cuda/tensors          (1) │ 14263.43 │   failed at 2026-04-06T13:50:13.610                                                                                                                                 
                                                                                                                                                                                                           
Output generated during execution of 'cuda/factorizations':                                                                                                                                                
┌ ---------------------------------------                                                                                                                                                                  
│ Factorizations with symmetry: TensorKitSectors.Trivial                                                                                                                                                   
│ ---------------------------------------                                                                                                                                                                  
│ ---------------------------------------                                                                                                                                                                  
│ Factorizations with symmetry: Irrep[ℤ₂]                                                                                                                                                                  
│ ---------------------------------------                                                                                                                                                                  
│ ---------------------------------------                                                                                                                                                                  
│ Factorizations with symmetry: Irrep[ℤ₃]                                                                                                                                                                  
│ ---------------------------------------                                                                                                                                                                  
│ ---------------------------------------                                                                                                                                                                  
│ Factorizations with symmetry: Irrep[U₁]                                                                                                                                                                  
│ ---------------------------------------                                                                                                                                                                  
│ ---------------------------------------                                                                                                                                                                  
│ Factorizations with symmetry: FermionParity                                                                                                                                                              
│ ---------------------------------------                                                                                                                                                                  
│ ---------------------------------------                                                                                                                                                                  
│ Factorizations with symmetry: GroupElement[ℤ{4}, 2]                                                                                                                                                      
│ ---------------------------------------                                                                                                                                                                  
│ ┌ Warning: Tensors with real data might be incompatible with sector type TensorKitSectors.Z4Element{2}                                                                                                   
│ └ @ TensorKit ~/.julia/dev/TensorKit/src/tensors/tensor.jl:32                                                                                                                                            
│ ---------------------------------------                                                                                                                                                                  
│ Factorizations with symmetry: GroupElement[ℤ{3}, 1]                                                                                                                                                      
│ ---------------------------------------                                                                                                                                                                  
│ ---------------------------------------                                                                                                                                                                  
│ Factorizations with symmetry: Irrep[CU₁]                                                                                                                                                                 
│ ---------------------------------------                                                                                                                                                                  
│ ---------------------------------------                                                                                                                                                                  
│ Factorizations with symmetry: Irrep[SU₂]                                                                                                                                                                 
│ ---------------------------------------                                                                                                                                                                  
│ ---------------------------------------                                                                                                                                                                  
│ Factorizations with symmetry: (FermionParity ⊠ Irrep[CU₁])                                                                                                                                               
│ ---------------------------------------                                                                                                                                                                  
│ ---------------------------------------                                                                                                                                                                  
│ Factorizations with symmetry: FermionSpin                                                                                                                                                                
│ ---------------------------------------                                                                                                                                                                  
│ ---------------------------------------                                                                                                                                                                  
│ Factorizations with symmetry: (FermionParity ⊠ Irrep[SU₂] ⊠ Irrep[U₁])                                                                                                                                   
│ ---------------------------------------            
│ ---------------------------------------                                                                                                                                                                  
│ Factorizations with symmetry: FibonacciAnyon                                                                                                                                                             
│ ---------------------------------------                                                                                                                                                                  
│ ---------------------------------------                                                                                                                                                                  
│ Factorizations with symmetry: Irrep[A₄]                                                                                                                                                                  
│ ---------------------------------------                                                                                                                                                                  
│ ---------------------------------------                                                                                                                                                                  
│ Factorizations with symmetry: (FermionParity ⊠ Irrep[A₄])                                                                                                                                                
│ ---------------------------------------                                                                                                                                                                  
│ ---------------------------------------                                                                                                                                                                  
│ Factorizations with symmetry: (Irrep[A₄] ⊠ GroupElement[ℤ{4}, 2])                                                                                                                                        
│ ---------------------------------------                                                                                                                                                                  
│ ---------------------------------------                                                                                                                                                                  
│ Factorizations with symmetry: TensorKitSectors.IsingBimodule                                                                                                                                             
│ ---------------------------------------                                                                                                                                                                  
│ ---------------------------------------                                                                                                                                                                  
│ Factorizations with symmetry: (TensorKitSectors.IsingBimodule ⊠ Irrep[A₄])                                                                                                                               
└ ---------------------------------------                                                                                                                                                                  
                                                                                                                                                                                                           
Output generated during execution of 'cuda/tensors':                                                                                                                                                       
┌ ---------------------------------------                                                                                                                                                                  
│ CUDA Tensors with symmetry: TensorKitSectors.Trivial                                                                                                                                                     
│ ---------------------------------------                                                                                                                                                                  
│ ---------------------------------------                                                                                                                                                                  
│ CUDA Tensors with symmetry: Irrep[ℤ₂]                                                                                                                                                                    
│ ---------------------------------------                                                                                                                                                                  
│ ---------------------------------------                                                                                                                                                                  
│ CUDA Tensors with symmetry: Irrep[ℤ₃]                                                                                                                                                                    
│ ---------------------------------------                                                                                                                                                                  
│ ---------------------------------------                                                                                                                                                                  
│ CUDA Tensors with symmetry: Irrep[U₁]                                                                                                                                                                    
│ ---------------------------------------                                                                                                                                                                  
│ ---------------------------------------                                                                                                                                                                  
│ CUDA Tensors with symmetry: FermionParity                                                                                                                                                                
│ ---------------------------------------                                                                                                                                                                  
│ ┌ Warning: FermionParity Arrays do not preserve categorical properties.                                                                                                                                  
│ └ @ TensorKitSectors ~/.julia/packages/TensorKitSectors/QxLrg/src/fermions.jl:57                                                                                                                         
│ ---------------------------------------                                                                                                                                                                  
│ CUDA Tensors with symmetry: GroupElement[ℤ{4}, 2]                                                                                                                                                        
│ ---------------------------------------                                                                                                                                                                  
│ ┌ Warning: Tensors with real data might be incompatible with sector type TensorKitSectors.Z4Element{2}                                                                                                   
│ └ @ TensorKit ~/.julia/dev/TensorKit/src/tensors/tensor.jl:32                                                                                                                                            
│ ---------------------------------------                                                                                                                                                                  
│ CUDA Tensors with symmetry: GroupElement[ℤ{3}, 1]                                                                                                                                                        
│ ---------------------------------------                                                                                                                                                                  
│ ---------------------------------------                                                                                                                                                                  
│ CUDA Tensors with symmetry: Irrep[CU₁]                                                                                                                                                                   
│ ---------------------------------------                                                                                                                                                                  
│ ---------------------------------------                                                                                                                                                                  
│ CUDA Tensors with symmetry: Irrep[SU₂]                                                                                                                                                                   
│ ---------------------------------------                                                                                                                                                                  
│ ---------------------------------------                                                                                                                                                                  
│ CUDA Tensors with symmetry: (FermionParity ⊠ Irrep[CU₁])                                           
│ ---------------------------------------                                                                                                                                                                  
│ CUDA Tensors with symmetry: FermionSpin                                                                                                                                                                  
│ ---------------------------------------                                                                                                                                                                  
│ ---------------------------------------                                                                                                                                                                  
│ CUDA Tensors with symmetry: (FermionParity ⊠ Irrep[SU₂] ⊠ Irrep[U₁])                                                                                                                                     
│ ---------------------------------------                                                                                                                                                                  
│ ---------------------------------------                                                                                                                                                                  
│ CUDA Tensors with symmetry: FibonacciAnyon                                                                                                                                                               
│ ---------------------------------------                                                                                                                                                                  
│ ---------------------------------------                                                                                                                                                                  
│ CUDA Tensors with symmetry: Irrep[A₄]                                                                                                                                                                    
│ ---------------------------------------                                                                                                                                                                  
│ ---------------------------------------                                                                                                                                                                  
│ CUDA Tensors with symmetry: (FermionParity ⊠ Irrep[A₄])                                                                                                                                                  
│ ---------------------------------------                                                                                                                                                                  
│ ---------------------------------------                                                                                                                                                                  
│ CUDA Tensors with symmetry: (Irrep[A₄] ⊠ GroupElement[ℤ{4}, 2])                                                                                                                                          
│ ---------------------------------------                                                                                                                                                                  
│ ---------------------------------------                                                                                                                                                                  
│ CUDA Tensors with symmetry: TensorKitSectors.IsingBimodule                                                                                                                                               
│ ---------------------------------------                                                                                                                                                                  
│ ---------------------------------------                                                                                                                                                                  
│ CUDA Tensors with symmetry: (TensorKitSectors.IsingBimodule ⊠ Irrep[A₄])                                                                                                                                 
└ ---------------------------------------                                                                                                                                                                  
                                                                                                                                                                                                           
Test Summary:                                                                    |  Pass  Fail  Error  Total       Time                                                                                    
  Overall                                                                        | 75462    36     22  75520  239m29.0s                                                                                    
    cuda/factorizations                                                          | 32064           18  32082   51m41.3s                                                                                    
      Factorizations with symmetry: TensorKitSectors.Trivial                     |  2004            1   2005    9m13.0s                                                                                    
        QR decomposition                                                         |   240                 240    3m19.6s                                                                                    
        LQ decomposition                                                         |   198                 198       8.3s                                                                                    
        Polar decomposition                                                      |   112                 112      59.3s                                                                                    
        SVD                                                                      |   476                 476    1m28.3s                                                                                    
        truncated SVD                                                            |   658                 658    1m13.0s                                                                                    
        Eigenvalue decomposition                                                 |    12            1     13      47.8s                                                                                    
        Condition number and rank                                                |    92                  92      26.4s                                                                                    
        Hermitian projections                                                    |    88                  88      47.2s                                                                                    
        Isometric projections                                                    |   128                 128       2.5s                                                                                    
      Factorizations with symmetry: Irrep[ℤ₂]                                    |  2004            1   2005    2m10.8s              
              QR decomposition                                                         |   240                 240      39.7s                                                                                    
        LQ decomposition                                                         |   198                 198       7.9s                                                                                    
        Polar decomposition                                                      |   112                 112       9.6s                                                                                    
        SVD                                                                      |   476                 476      25.9s                                                                                    
        truncated SVD                                                            |   658                 658      26.8s                                                                                    
        Eigenvalue decomposition                                                 |    12            1     13       3.1s                                                                                    
        Condition number and rank                                                |    92                  92       7.5s                                                                                    
        Hermitian projections                                                    |    88                  88       6.6s                                                                                    
        Isometric projections                                                    |   128                 128       3.1s                                                                                    
      Factorizations with symmetry: Irrep[ℤ₃]                                    |  2004            1   2005    2m11.4s                                                                                    
        QR decomposition                                                         |   240                 240      38.8s                                                                                    
        LQ decomposition                                                         |   198                 198       8.2s                                                                                    
        Polar decomposition                                                      |   112                 112       9.5s                                                                                    
        SVD                                                                      |   476                 476      26.2s                                                                                    
        truncated SVD                                                            |   658                 658      27.4s                                                                                    
        Eigenvalue decomposition                                                 |    12            1     13       3.6s                                                                                    
        Condition number and rank                                                |    92                  92       7.2s                                                                                    
        Hermitian projections                                                    |    88                  88       6.6s                                                                                    
        Isometric projections                                                    |   128                 128       3.3s                                                                                    
      Factorizations with symmetry: Irrep[U₁]                                    |  2004            1   2005    3m08.8s                                                                                    
        QR decomposition                                                         |   240                 240      52.5s                                                                                    
        LQ decomposition                                                         |   198                 198      13.5s                                                                                    
        Polar decomposition                                                      |   112                 112      13.7s                                                                                    
        SVD                                                                      |   476                 476      40.3s                                                                                    
        truncated SVD                                                            |   658                 658      38.2s                                                                                    
        Eigenvalue decomposition                                                 |    12            1     13       5.9s                                                                                    
        Condition number and rank                                                |    92                  92       9.2s                                                                                    
        Hermitian projections                                                    |    88                  88      10.1s                                                                                    
        Isometric projections                                                    |   128                 128       4.7s                                                                                    
      Factorizations with symmetry: FermionParity                                |  2004            1   2005    2m10.3s                                                                                    
        QR decomposition                                                         |   240                 240      38.0s                                                                                    
        LQ decomposition                                                         |   198                 198       7.9s                                                                                    
        Polar decomposition                                                      |   112                 112       9.6s                                                                                    
        SVD                                                                      |   476                 476      26.7s                                                                                    
        truncated SVD                                                            |   658                 658      26.8s                                                                                    
        Eigenvalue decomposition                                                 |    12            1     13       3.4s                                                                                    
        Condition number and rank                                                |    92                  92       7.5s                                                                                    
        Hermitian projections                                                    |    88                  88       6.6s                                                                                    
        Isometric projections                                                    |   128                 128       3.3s                                                                                    
      Factorizations with symmetry: GroupElement[ℤ{4}, 2]                        |  2004            1   2005    2m20.1s                                                                                    
        QR decomposition                                                         |   240                 240      43.0s                                                                                    
        LQ decomposition                                                         |   198                 198       8.7s                                                                                    
        Polar decomposition                                                      |   112                 112       9.9s                                                                                    
        SVD                                                                      |   476                 476      28.3s                                                                                    
        truncated SVD                                                            |   658                 658      27.9s                                                                                    
        Eigenvalue decomposition                                                 |    12            1     13       3.2s                                                                                    
        Condition number and rank                                                |    92                  92       7.8s                                                                                    
        Hermitian projections                                                    |    88                  88       7.1s                                                                                    
        Isometric projections                                                    |   128                 128       3.5s 
              Factorizations with symmetry: GroupElement[ℤ{3}, 1]                        |  2004            1   2005    2m15.9s                                                                                    
        QR decomposition                                                         |   240                 240      40.6s                                                                                    
        LQ decomposition                                                         |   198                 198       8.7s                                                                                    
        Polar decomposition                                                      |   112                 112       9.9s                                                                                    
        SVD                                                                      |   476                 476      27.4s                                                                                    
        truncated SVD                                                            |   658                 658      27.8s                                                                                    
        Eigenvalue decomposition                                                 |    12            1     13       3.2s                                                                                    
        Condition number and rank                                                |    92                  92       7.6s                                                                                    
        Hermitian projections                                                    |    88                  88       6.9s                                                                                    
        Isometric projections                                                    |   128                 128       3.3s                                                                                    
      Factorizations with symmetry: Irrep[CU₁]                                   |  2004            1   2005    3m26.1s                                                                                    
        QR decomposition                                                         |   240                 240      58.3s                                                                                    
        LQ decomposition                                                         |   198                 198      14.0s                                                                                    
        Polar decomposition                                                      |   112                 112      14.6s                                                                                    
        SVD                                                                      |   476                 476      42.2s                                                                                    
        truncated SVD                                                            |   658                 658      41.2s                                                                                    
        Eigenvalue decomposition                                                 |    12            1     13       9.2s                                                                                    
        Condition number and rank                                                |    92                  92      10.2s                                                                                    
        Hermitian projections                                                    |    88                  88      10.7s                                                                                    
        Isometric projections                                                    |   128                 128       5.0s                                                                                    
      Factorizations with symmetry: Irrep[SU₂]                                   |  2004            1   2005    3m17.8s                                                                                    
        QR decomposition                                                         |   240                 240      56.5s                                                                                    
        LQ decomposition                                                         |   198                 198      14.6s                                                                                    
        Polar decomposition                                                      |   112                 112      14.1s                                                                                    
        SVD                                                                      |   476                 476      42.5s                                                                                    
        truncated SVD                                                            |   658                 658      39.8s                                                                                    
        Eigenvalue decomposition                                                 |    12            1     13       4.2s                                                                                    
        Condition number and rank                                                |    92                  92       9.8s                                                                                    
        Hermitian projections                                                    |    88                  88      10.6s                                                                                    
        Isometric projections                                                    |   128                 128       5.1s                                                                                    
      Factorizations with symmetry: (FermionParity ⊠ Irrep[CU₁])                 |  2004            1   2005    3m29.2s                                                                                    
        QR decomposition                                                         |   240                 240    1m01.5s                                                                                    
        LQ decomposition                                                         |   198                 198      15.5s                                                                                    
        Polar decomposition                                                      |   112                 112      14.9s                                                                                    
        SVD                                                                      |   476                 476      44.8s                                                                                    
        truncated SVD                                                            |   658                 658      40.8s                                                                                    
        Eigenvalue decomposition                                                 |    12            1     13       5.2s                                                                                    
        Condition number and rank                                                |    92                  92      10.0s                                                                                    
        Hermitian projections                                                    |    88                  88      10.8s                                                                                    
        Isometric projections                                                    |   128                 128       5.1s                                                                                    
      Factorizations with symmetry: FermionSpin                                  |  2004            1   2005    3m27.3s                                                                                    
        QR decomposition                                                         |   240                 240    1m00.6s                                                                                    
        LQ decomposition                                                         |   198                 198      15.0s                                                                                    
        Polar decomposition                                                      |   112                 112      15.1s                                                                                    
        SVD                                                                      |   476                 476      44.2s                                                                                    
        truncated SVD                                                            |   658                 658      41.1s                                                                                    
        Eigenvalue decomposition                                                 |    12            1     13       4.4s                                                                                    
        Condition number and rank                                                |    92                  92      10.1s                                                                                    
        Hermitian projections                                                    |    88                  88      10.9s                                                                                    
        Isometric projections                                                    |   128                 128       5.2s                             
      Factorizations with symmetry: (FermionParity ⊠ Irrep[SU₂] ⊠ Irrep[U₁])     |  2004            1   2005    3m37.4s                                                                                    
        QR decomposition                                                         |   240                 240    1m02.4s                                                                                    
        LQ decomposition                                                         |   198                 198      15.8s                                                                                    
        Polar decomposition                                                      |   112                 112      14.8s                                                                                    
        SVD                                                                      |   476                 476      47.5s                                                                                    
        truncated SVD                                                            |   658                 658      44.9s                                                                                    
        Eigenvalue decomposition                                                 |    12            1     13       4.7s                                                                                    
        Condition number and rank                                                |    92                  92      10.4s                                                                                    
        Hermitian projections                                                    |    88                  88      11.0s                                                                                    
        Isometric projections                                                    |   128                 128       5.4s                                                                                    
      Factorizations with symmetry: FibonacciAnyon                               |  2004            1   2005    2m27.8s                                                                                    
        QR decomposition                                                         |   240                 240      42.5s                                                                                    
        LQ decomposition                                                         |   198                 198       8.7s                                                                                    
        Polar decomposition                                                      |   112                 112      10.8s                                                                                    
        SVD                                                                      |   476                 476      27.7s                                                                                    
        truncated SVD                                                            |   658                 658      30.9s                                                                                    
        Eigenvalue decomposition                                                 |    12            1     13       3.8s                                                                                    
        Condition number and rank                                                |    92                  92      11.1s                                                                                    
        Hermitian projections                                                    |    88                  88       7.1s                                                                                    
        Isometric projections                                                    |   128                 128       4.6s                                                                                    
      Factorizations with symmetry: Irrep[A₄]                                    |  2004            1   2005    2m36.6s                                                                                    
        QR decomposition                                                         |   240                 240      47.0s                                                                                    
        LQ decomposition                                                         |   198                 198       9.9s                                                                                    
        Polar decomposition                                                      |   112                 112      12.3s                                                                                    
        SVD                                                                      |   476                 476      31.2s                                                                                    
        truncated SVD                                                            |   658                 658      30.8s                                                                                    
        Eigenvalue decomposition                                                 |    12            1     13       3.8s                                                                                    
        Condition number and rank                                                |    92                  92       8.7s                                                                                    
        Hermitian projections                                                    |    88                  88       8.2s                                                                                    
        Isometric projections                                                    |   128                 128       4.1s                                                                                    
      Factorizations with symmetry: (FermionParity ⊠ Irrep[A₄])                  |  2004            1   2005    2m52.4s                                                                                    
        QR decomposition                                                         |   240                 240      52.5s                                                                                    
        LQ decomposition                                                         |   198                 198      11.0s                                                                                    
        Polar decomposition                                                      |   112                 112      15.2s                                                                                    
        SVD                                                                      |   476                 476      33.5s                                                                                    
        truncated SVD                                                            |   658                 658      32.9s                                                                                    
        Eigenvalue decomposition                                                 |    12            1     13       5.0s                                                                                    
        Condition number and rank                                                |    92                  92       9.0s                                                                                    
        Hermitian projections                                                    |    88                  88       8.1s                                                                                    
        Isometric projections                                                    |   128                 128       4.4s                                                                                    
      Factorizations with symmetry: (Irrep[A₄] ⊠ GroupElement[ℤ{4}, 2])          |  2004            1   2005    2m43.6s                                                                                    
        QR decomposition                                                         |   240                 240      48.5s                                                                                    
        LQ decomposition                                                         |   198                 198      10.6s                                                                                    
        Polar decomposition                                                      |   112                 112      12.4s                                                                                    
        SVD                                                                      |   476                 476      32.8s                                                                                    
        truncated SVD                                                            |   658                 658      32.1s                                                                                    
        Eigenvalue decomposition                                                 |    12            1     13       4.2s                                                                                    
        Condition number and rank                                                |    92                  92       9.4s                                                                                    
        Hermitian projections                                                    |    88                  88       8.9s                                                                                    
        Isometric projections                                                    |   128                 128       3.9s                                                                                    
      Factorizations with symmetry: TensorKitSectors.IsingBimodule               |                  1      1       0.9s          
    cuda/tensors                                                                 | 43398    36      4  43438  237m43.1s                                                                                    
      Tensors with symmetry: TensorKitSectors.Trivial                            |  3417     2          3419    8m48.2s                                                                                    
        Basic tensor properties                                                  |   150                 150    1m42.6s                                                                                    
        Conversion to/from host                                                  |    39                  39       1.4s                                                                                    
        Adapt                                                                    |    21                  21       1.8s                                                                                    
        Tensor Dict conversion                                                   |     6                   6       3.7s                                                                                    
        Basic linear algebra                                                     |    80                  80    1m10.0s                                                                                    
        Trivial space insertion and removal                                      |    52     2            54       5.8s                                                                                    
        Basic linear algebra: test via CPU                                       |    10                  10       3.6s                                                                                    
        Real and imaginary parts                                                 |    42                  42      10.9s                                                                                    
        Tensor conversion                                                        |     8                   8       2.8s                                                                                    
        Permutations: test via inner product invariance                          |  2190                2190      47.5s                                                                                    
        Permutations: test via CPU                                               |   726                 726      13.5s                                                                                    
        Full trace: test self-consistency                                        |     4                   4      20.8s                                                                                    
        Partial trace: test self-consistency                                     |     1                   1       4.9s                                                                                    
        Trace: test via conversion                                               |     1                   1       4.6s                                                                                    
        Trace and contraction                                                    |     1                   1      16.3s                                                                                    
        Index flipping: test flipping inverse                                    |    10                  10       2.5s                                                                                    
        Multiplication of isometries: test properties                            |     6                   6      29.7s                                                                                    
        Multiplication and inverse: test compatibility                           |    16                  16      23.7s                                                                                    
        Multiplication and inverse: test via CPU                                 |    40                  40    1m18.2s                                                                                    
        Tensor functions                                                         |     4                   4      20.5s                                                                                    
        Tensor product: test via norm preservation                               |     4                   4       7.3s                                                                                    
        Tensor product: test via conversion                                      |     4                   4      40.7s                                                                                    
        Tensor product: test via tensor contraction                              |     2                   2      15.3s                                                                                    
      Tensors with symmetry: Irrep[ℤ₂]                                           |  3423     2          3425    3m24.3s                                                                                    
        Basic tensor properties                                                  |   150                 150       9.2s                                                                                    
        Conversion to/from host                                                  |    39                  39       1.0s                                                                                    
        Adapt                                                                    |    21                  21       1.6s                                                                                    
        Tensor Dict conversion                                                   |     6                   6       3.8s                                                                                    
        Basic linear algebra                                                     |    80                  80      15.8s                                                                                    
        Trivial space insertion and removal                                      |    58     2            60       5.4s                                                                                    
        Basic linear algebra: test via CPU                                       |    10                  10       1.4s                                                                                    
        Real and imaginary parts                                                 |    42                  42       3.1s                                                                                    
        Tensor conversion                                                        |     8                   8       0.4s                                                                                    
        Permutations: test via inner product invariance                          |  2190                2190      51.2s                                                                                    
        Permutations: test via CPU                                               |   726                 726      10.1s                                                                                    
        Full trace: test self-consistency                                        |     4                   4      14.3s                                                                                    
        Partial trace: test self-consistency                                     |     1                   1       6.9s                                                                                    
        Trace: test via conversion                                               |     1                   1       4.6s                                                                                    
        Trace and contraction                                                    |     1                   1      12.3s                                                                                    
        Index flipping: test flipping inverse                                    |    10                  10       1.1s                                                                                    
        Multiplication of isometries: test properties                            |     6                   6       3.8s                                                                                    
        Multiplication and inverse: test compatibility                           |    16                  16       3.5s                                                                                    
        Multiplication and inverse: test via CPU                                 |    40                  40      28.1s                                                                                    
        Tensor functions                                                         |     4                   4       1.4s                                                                                    
        Tensor product: test via norm preservation                               |     4                   4       4.3s                                                                                    
        Tensor product: test via conversion                                      |     4                   4       9.4s                                                                                    
        Tensor product: test via tensor contraction                              |     2                   2      11.5s                                                                                    
      Tensors with symmetry: Irrep[ℤ₃]                                           |  3429     2          3431    3m37.6s              
        Basic tensor properties                                                  |   150                 150       5.8s                                                                                    
        Conversion to/from host                                                  |    39                  39       1.0s                                                                                    
        Adapt                                                                    |    21                  21       1.6s                                                                                    
        Tensor Dict conversion                                                   |     6                   6       3.8s                                                                                    
        Basic linear algebra                                                     |    80                  80      11.7s                                                                                    
        Trivial space insertion and removal                                      |    64     2            66       5.1s                                                                                    
        Basic linear algebra: test via CPU                                       |    10                  10       1.7s                                                                                    
        Real and imaginary parts                                                 |    42                  42       3.0s                                                                                    
        Tensor conversion                                                        |     8                   8       0.4s                                                                                    
        Permutations: test via inner product invariance                          |  2190                2190    1m09.5s                                                                                    
        Permutations: test via CPU                                               |   726                 726      10.3s                                                                                    
        Full trace: test self-consistency                                        |     4                   4      11.2s                                                                                    
        Partial trace: test self-consistency                                     |     1                   1       6.5s                                                                                    
        Trace: test via conversion                                               |     1                   1       0.9s                                                                                    
        Trace and contraction                                                    |     1                   1      11.8s                                                                                    
        Index flipping: test flipping inverse                                    |    10                  10       1.5s                                                                                    
        Multiplication of isometries: test properties                            |     6                   6       4.1s                                                                                    
        Multiplication and inverse: test compatibility                           |    16                  16       3.8s                                                                                    
        Multiplication and inverse: test via CPU                                 |    40                  40      28.9s                                                                                    
        Tensor functions                                                         |     4                   4       1.5s                                                                                    
        Tensor product: test via norm preservation                               |     4                   4      13.5s                                                                                    
        Tensor product: test via conversion                                      |     4                   4       9.7s                                                                                    
        Tensor product: test via tensor contraction                              |     2                   2      10.3s                                                                                    
      Tensors with symmetry: Irrep[U₁]                                           |  3441     2          3443    3m57.2s                                                                                    
        Basic tensor properties                                                  |   150                 150       8.1s                                                                                    
        Conversion to/from host                                                  |    39                  39       1.3s                                                                                    
        Adapt                                                                    |    21                  21       2.2s                                                                                    
        Tensor Dict conversion                                                   |     6                   6       4.2s                                                                                    
        Basic linear algebra                                                     |    80                  80      14.2s                                                                                    
        Trivial space insertion and removal                                      |    76     2            78       5.6s                                                                                    
        Basic linear algebra: test via CPU                                       |    10                  10       1.8s                                                                                    
        Real and imaginary parts                                                 |    42                  42       3.8s                                                                                    
        Tensor conversion                                                        |     8                   8       0.5s                                                                                    
        Permutations: test via inner product invariance                          |  2190                2190    1m06.4s                                                                                    
        Permutations: test via CPU                                               |   726                 726       7.2s                                                                                    
        Full trace: test self-consistency                                        |     4                   4      12.5s                                                                                    
        Partial trace: test self-consistency                                     |     1                   1       7.9s                                                                                    
        Trace: test via conversion                                               |     1                   1       1.3s                                                                                    
        Trace and contraction                                                    |     1                   1      14.7s                                                                                    
        Index flipping: test flipping inverse                                    |    10                  10       1.1s                                                                                    
        Multiplication of isometries: test properties                            |     6                   6       5.4s                                                                                    
        Multiplication and inverse: test compatibility                           |    16                  16       6.5s                                                                                    
        Multiplication and inverse: test via CPU                                 |    40                  40      36.8s                                                                                    
        Tensor functions                                                         |     4                   4       1.7s                                                                                    
        Tensor product: test via norm preservation                               |     4                   4       9.4s                                                                                    
        Tensor product: test via conversion                                      |     4                   4      10.0s                                                                                    
        Tensor product: test via tensor contraction                              |     2                   2      14.5s                                                                                    
      Tensors with symmetry: FermionParity                                       |  3423     2          3425    3m03.5s         
        Basic tensor properties                                                  |   150                 150       5.4s                                                                                    
        Conversion to/from host                                                  |    39                  39       1.0s                                                                                    
        Adapt                                                                    |    21                  21       1.9s                                                                                    
        Tensor Dict conversion                                                   |     6                   6       3.8s                                                                                    
        Basic linear algebra                                                     |    80                  80      11.2s                                                                                    
        Trivial space insertion and removal                                      |    58     2            60       5.5s                                                                                    
        Basic linear algebra: test via CPU                                       |    10                  10       1.4s                                                                                    
        Real and imaginary parts                                                 |    42                  42       3.0s                                                                                    
        Tensor conversion                                                        |     8                   8       0.4s                                                                                    
        Permutations: test via inner product invariance                          |  2190                2190      48.4s                                                                                    
        Permutations: test via CPU                                               |   726                 726       5.0s                                                                                    
        Full trace: test self-consistency                                        |     4                   4      12.2s                                                                                    
        Partial trace: test self-consistency                                     |     1                   1       5.9s                                                                                    
        Trace: test via conversion                                               |     1                   1       0.9s                                                                                    
        Trace and contraction                                                    |     1                   1      13.6s                                                                                    
        Index flipping: test flipping inverse                                    |    10                  10       2.4s                                                                                    
        Multiplication of isometries: test properties                            |     6                   6       4.0s                                                                                    
        Multiplication and inverse: test compatibility                           |    16                  16       3.7s                                                                                    
        Multiplication and inverse: test via CPU                                 |    40                  40      28.7s                                                                                    
        Tensor functions                                                         |     4                   4       1.5s                                                                                    
        Tensor product: test via norm preservation                               |     4                   4       4.4s                                                                                    
        Tensor product: test via conversion                                      |     4                   4       7.1s                                                                                    
        Tensor product: test via tensor contraction                              |     2                   2      10.5s                                                                                    
      Tensors with symmetry: GroupElement[ℤ{4}, 2]                               |   366     2      1    369    1m23.6s                                                                                    
        Basic tensor properties                                                  |   150                 150       6.0s                                                                                    
        Conversion to/from host                                                  |    39                  39       1.1s                                                                                    
        Adapt                                                                    |    21                  21       1.8s                                                                                    
        Tensor Dict conversion                                                   |     6                   6       4.2s                                                                                    
        Trivial space insertion and removal                                      |    70     2            72       5.5s                                                                                    
        Tensor conversion                                                        |     8                   8       2.8s                                                                                    
        Index flipping: test flipping inverse                                    |    10                  10       3.1s                                                                                    
        Multiplication of isometries: test properties                            |     6                   6       4.9s                                                                                    
        Multiplication and inverse: test compatibility                           |    16                  16       5.0s                                                                                    
        Multiplication and inverse: test via CPU                                 |    40                  40      35.5s                                                                                    
        Tensor product: test via norm preservation                               |                  1      1      13.8s                                                                                    
      Tensors with symmetry: GroupElement[ℤ{3}, 1]                               |   350     2      1    353    1m13.9s                                                                                    
        Basic tensor properties                                                  |   150                 150       6.1s                                                                                    
        Conversion to/from host                                                  |    39                  39       1.2s                                                                                    
        Adapt                                                                    |    21                  21       1.9s                                                                                    
        Tensor Dict conversion                                                   |     6                   6       4.1s                                                                                    
        Trivial space insertion and removal                                      |    64     2            66       6.6s                                                                                    
        Tensor conversion                                                        |     8                   8       2.8s                                                                                    
        Multiplication of isometries: test properties                            |     6                   6       4.6s                                                                                    
        Multiplication and inverse: test compatibility                           |    16                  16       4.5s                                                                                    
        Multiplication and inverse: test via CPU                                 |    40                  40      31.6s                                                                                    
        Tensor product: test via norm preservation                               |                  1      1      10.4s                                                                                    
      Tensors with symmetry: Irrep[CU₁]                                          |  3435     2          3437    8m46.8s                                                                                    
        Basic tensor properties                                                  |   150                 150      31.0s                                                                                    
        Conversion to/from host                                                  |    39                  39       1.4s                                                                                    
        Adapt                                                                    |    21                  21       2.3s                                                                                    
        Tensor Dict conversion                                                   |     6                   6       4.2s                                                                                    
        Basic linear algebra                                                     |    80                  80      22.7s                                                                                    
        Trivial space insertion and removal                                      |    70     2            72       5.5s                                                                                    
        Basic linear algebra: test via CPU                                       |    10                  10       4.9s                            
        Real and imaginary parts                                                 |    42                  42       4.0s                                                                                    
        Tensor conversion                                                        |     8                   8       0.5s                                                                                    
        Permutations: test via inner product invariance                          |  2190                2190    3m37.3s                                                                                    
        Permutations: test via CPU                                               |   726                 726      33.8s                                                                                    
        Full trace: test self-consistency                                        |     4                   4      23.3s                                                                                    
        Partial trace: test self-consistency                                     |     1                   1      17.0s                                                                                    
        Trace: test via conversion                                               |     1                   1       1.9s                                                                                    
        Trace and contraction                                                    |     1                   1      26.7s                                                                                    
        Index flipping: test flipping inverse                                    |    10                  10       1.3s                                                                                    
        Multiplication of isometries: test properties                            |     6                   6       5.7s                                                                                    
        Multiplication and inverse: test compatibility                           |    16                  16       6.8s                                                                                    
        Multiplication and inverse: test via CPU                                 |    40                  40      40.8s                                                                                    
        Tensor functions                                                         |     4                   4       2.2s                                                                                    
        Tensor product: test via norm preservation                               |     4                   4      20.4s                                                                                    
        Tensor product: test via conversion                                      |     4                   4      24.9s                                                                                    
        Tensor product: test via tensor contraction                              |     2                   2      28.1s                                                                                    
      Tensors with symmetry: Irrep[SU₂]                                          |  3435     2          3437    6m09.7s                                                                                    
        Basic tensor properties                                                  |   150                 150       9.0s                                                                                    
        Conversion to/from host                                                  |    39                  39       1.3s                                                                                    
        Adapt                                                                    |    21                  21       2.2s                                                                                    
        Tensor Dict conversion                                                   |     6                   6       4.8s                                                                                    
        Basic linear algebra                                                     |    80                  80      16.0s                                                                                    
        Trivial space insertion and removal                                      |    70     2            72       5.9s                                                                                    
        Basic linear algebra: test via CPU                                       |    10                  10       3.3s                                                                                    
        Real and imaginary parts                                                 |    42                  42       4.2s                                                                                    
        Tensor conversion                                                        |     8                   8       0.5s                                                                                    
        Permutations: test via inner product invariance                          |  2190                2190    2m23.5s                                                                                    
        Permutations: test via CPU                                               |   726                 726      15.5s                                                                                    
        Full trace: test self-consistency                                        |     4                   4      21.5s                                                                                    
        Partial trace: test self-consistency                                     |     1                   1      16.2s                                                                                    
        Trace: test via conversion                                               |     1                   1       1.8s                                                                                    
        Trace and contraction                                                    |     1                   1      23.5s                                                                                    
        Index flipping: test flipping inverse                                    |    10                  10       1.0s                                                                                    
        Multiplication of isometries: test properties                            |     6                   6       5.8s                                                                                    
        Multiplication and inverse: test compatibility                           |    16                  16      10.7s                                                                                    
        Multiplication and inverse: test via CPU                                 |    40                  40      37.9s                                                                                    
        Tensor functions                                                         |     4                   4       2.3s                                                                                    
        Tensor product: test via norm preservation                               |     4                   4      10.4s                                                                                    
        Tensor product: test via conversion                                      |     4                   4      11.0s                                                                                    
        Tensor product: test via tensor contraction                              |     2                   2      20.9s                                                                                    
      Tensors with symmetry: (FermionParity ⊠ Irrep[CU₁])                        |  3435     2          3437    7m56.0s                                                                                    
        Basic tensor properties                                                  |   150                 150      10.7s                                                                                    
        Conversion to/from host                                                  |    39                  39       1.4s                                                                                    
        Adapt                                                                    |    21                  21       2.3s                                                                                    
        Tensor Dict conversion                                                   |     6                   6       4.5s                                                                                    
        Basic linear algebra                                                     |    80                  80      16.5s                                                                                    
        Trivial space insertion and removal                                      |    70     2            72       6.2s                                                                                    
        Basic linear algebra: test via CPU                                       |    10                  10       3.4s                                                                                    
        Real and imaginary parts                                                 |    42                  42       4.2s                                                                                    
        Tensor conversion                                                        |     8                   8       0.5s                                                                                    
        Permutations: test via inner product invariance                          |  2190                2190    3m35.4s                                                                                    
        Permutations: test via CPU                                               |   726                 726      27.1s                                                                                    
        Full trace: test self-consistency                                        |     4                   4      25.1s             
        Partial trace: test self-consistency                                     |     1                   1      18.7s                                                                                    
        Trace: test via conversion                                               |     1                   1       1.9s                                                                                    
        Trace and contraction                                                    |     1                   1      26.3s                                                                                    
        Index flipping: test flipping inverse                                    |    10                  10       1.5s                                                                                    
        Multiplication of isometries: test properties                            |     6                   6       5.8s                                                                                    
        Multiplication and inverse: test compatibility                           |    16                  16       7.0s                                                                                    
        Multiplication and inverse: test via CPU                                 |    40                  40      40.3s                                                                                    
        Tensor functions                                                         |     4                   4       2.3s                                                                                    
        Tensor product: test via norm preservation                               |     4                   4      21.0s                                                                                    
        Tensor product: test via conversion                                      |     4                   4      11.7s                                                                                    
        Tensor product: test via tensor contraction                              |     2                   2      21.7s                                                                                    
      Tensors with symmetry: FermionSpin                                         |  3435     2          3437    6m24.0s                                                                                    
        Basic tensor properties                                                  |   150                 150      10.2s                                                                                    
        Conversion to/from host                                                  |    39                  39       1.4s                                                                                    
        Adapt                                                                    |    21                  21       2.3s                                                                                    
        Tensor Dict conversion                                                   |     6                   6       4.3s                                                                                    
        Basic linear algebra                                                     |    80                  80      15.6s                                                                                    
        Trivial space insertion and removal                                      |    70     2            72       5.9s                                                                                    
        Basic linear algebra: test via CPU                                       |    10                  10       3.4s                                                                                    
        Real and imaginary parts                                                 |    42                  42       4.3s                                                                                    
        Tensor conversion                                                        |     8                   8       0.5s                                                                                    
        Permutations: test via inner product invariance                          |  2190                2190    2m31.1s                                                                                    
        Permutations: test via CPU                                               |   726                 726      16.3s                                                                                    
        Full trace: test self-consistency                                        |     4                   4      23.3s                                                                                    
        Partial trace: test self-consistency                                     |     1                   1      17.6s                                                                                    
        Trace: test via conversion                                               |     1                   1       1.9s                                                                                    
        Trace and contraction                                                    |     1                   1      25.4s                                                                                    
        Index flipping: test flipping inverse                                    |    10                  10       1.1s                                                                                    
        Multiplication of isometries: test properties                            |     6                   6       5.8s                                                                                    
        Multiplication and inverse: test compatibility                           |    16                  16       6.8s                                                                                    
        Multiplication and inverse: test via CPU                                 |    40                  40      39.7s                                                                                    
        Tensor functions                                                         |     4                   4       2.3s                                                                                    
        Tensor product: test via norm preservation                               |     4                   4      10.7s                                                                                    
        Tensor product: test via conversion                                      |     4                   4      11.2s                                                                                    
        Tensor product: test via tensor contraction                              |     2                   2      22.6s                                                                                    
      Tensors with symmetry: (FermionParity ⊠ Irrep[SU₂] ⊠ Irrep[U₁])            |  3447     2          3449    7m03.3s                                                                                    
        Basic tensor properties                                                  |   150                 150      11.3s                                                                                    
        Conversion to/from host                                                  |    39                  39       1.5s                                                                                    
        Adapt                                                                    |    21                  21       2.2s                                                                                    
        Tensor Dict conversion                                                   |     6                   6       4.5s                                                                                    
        Basic linear algebra                                                     |    80                  80      17.0s                                                                                    
        Trivial space insertion and removal                                      |    82     2            84       6.6s                                                                                    
        Basic linear algebra: test via CPU                                       |    10                  10       3.4s                                                                                    
        Real and imaginary parts                                                 |    42                  42       4.2s                                                                                    
        Tensor conversion                                                        |     8                   8       0.5s                                                                                    
        Permutations: test via inner product invariance                          |  2190                2190    2m52.3s                                                                                    
        Permutations: test via CPU                                               |   726                 726      16.7s                                                                                    
        Full trace: test self-consistency                                        |     4                   4      25.9s                                                                                    
        Partial trace: test self-consistency                                     |     1                   1      20.4s                                                                                    
        Trace: test via conversion                                               |     1                   1       2.0s                          
        Partial trace: test self-consistency                                     |     1                   1      20.4s                                                                                    
        Trace: test via conversion                                               |     1                   1       2.0s                                                                                    
        Trace and contraction                                                    |     1                   1      27.1s                                                                                    
        Index flipping: test flipping inverse                                    |    10                  10       1.4s                                                                                    
        Multiplication of isometries: test properties                            |     6                   6       6.1s                                                                                    
        Multiplication and inverse: test compatibility                           |    16                  16      10.3s                                                                                    
        Multiplication and inverse: test via CPU                                 |    40                  40      43.7s                                                                                    
        Tensor functions                                                         |     4                   4       2.3s                                                                                    
        Tensor product: test via norm preservation                               |     4                   4      10.2s                                                                                    
        Tensor product: test via conversion                                      |     4                   4      11.4s                                                                                    
        Tensor product: test via tensor contraction                              |     2                   2      22.0s                                                                                    
      Tensors with symmetry: FibonacciAnyon                                      |   354     2      1    357    1m15.7s                                                                                    
        Basic tensor properties                                                  |   150                 150       6.6s                                                                                    
        Conversion to/from host                                                  |    39                  39       1.1s                                                                                    
        Adapt                                                                    |    21                  21       1.8s                                                                                    
        Tensor Dict conversion                                                   |     6                   6       3.9s                                                                                    
        Trivial space insertion and removal                                      |    58     2            60       5.1s                                                                                    
        Tensor conversion                                                        |     8                   8       2.7s                                                                                    
        Index flipping: test flipping inverse                                    |    10                  10       2.1s                                                                                    
        Multiplication of isometries: test properties                            |     6                   6       4.4s                                                                                    
        Multiplication and inverse: test compatibility                           |    16                  16       4.2s                                                                                    
        Multiplication and inverse: test via CPU                                 |    40                  40      33.0s                                                                                    
        Tensor product: test via norm preservation                               |                  1      1      10.6s                                                                                    
      Tensors with symmetry: Irrep[A₄]                                           |  3435     2          3437  114m41.9s                                                                                    
        Basic tensor properties                                                  |   150                 150       6.8s                                                                                    
        Conversion to/from host                                                  |    39                  39       1.1s                                                                                    
        Adapt                                                                    |    21                  21       1.7s                                                                                    
        Tensor Dict conversion                                                   |     6                   6       4.3s                                                                                    
        Basic linear algebra                                                     |    80                  80      17.9s                                                                                    
        Trivial space insertion and removal                                      |    70     2            72       5.6s                                                                                    
        Basic linear algebra: test via CPU                                       |    10                  10       2.9s                                                                                    
        Real and imaginary parts                                                 |    42                  42       3.3s                                                                                    
        Tensor conversion                                                        |     8                   8       0.4s                                                                                    
        Permutations: test via inner product invariance                          |  2190                2190   12m44.6s                                                                                    
        Permutations: test via CPU                                               |   726                 726    1m50.4s                                                                                    
        Full trace: test self-consistency                                        |     4                   4      22.0s                                                                                    
        Partial trace: test self-consistency                                     |     1                   1      17.9s                                                                                    
        Trace: test via conversion                                               |     1                   1       3.0s                                                                                    
        Trace and contraction                                                    |     1                   1      21.6s                                                                                    
        Index flipping: test flipping inverse                                    |    10                  10       1.5s                                                                                    
        Multiplication of isometries: test properties                            |     6                   6       4.3s                                                                                    
        Multiplication and inverse: test compatibility                           |    16                  16       4.8s                                                                                    
        Multiplication and inverse: test via CPU                                 |    40                  40      32.3s                                                                                    
        Tensor functions                                                         |     4                   4       2.0s                                                                                    
        Tensor product: test via norm preservation                               |     4                   4   95m54.8s                                                                                    
        Tensor product: test via conversion                                      |     4                   4    1m11.8s                                                                                    
        Tensor product: test via tensor contraction                              |     2                   2      23.5s                                                                                    
      Tensors with symmetry: (FermionParity ⊠ Irrep[A₄])                         |  3453     2          3455   51m14.2s           
        Basic tensor properties                                                  |   150                 150       8.2s                                                                                    
        Conversion to/from host                                                  |    39                  39       1.2s                                                                                    
        Adapt                                                                    |    21                  21       1.9s                                                                                    
        Tensor Dict conversion                                                   |     6                   6       4.1s                                                                                    
        Basic linear algebra                                                     |    80                  80      14.2s                                                                                    
        Trivial space insertion and removal                                      |    88     2            90       6.5s                                                                                    
        Basic linear algebra: test via CPU                                       |    10                  10       3.7s                                                                                    
        Real and imaginary parts                                                 |    42                  42       4.0s                                                                                    
        Tensor conversion                                                        |     8                   8       0.5s                                                                                    
        Permutations: test via inner product invariance                          |  2190                2190    9m07.1s                                                                                    
        Permutations: test via CPU                                               |   726                 726    1m18.5s                                                                                    
        Full trace: test self-consistency                                        |     4                   4      22.8s                                                                                    
        Partial trace: test self-consistency                                     |     1                   1      17.6s                                                                                    
        Trace: test via conversion                                               |     1                   1       3.7s                                                                                    
        Trace and contraction                                                    |     1                   1      22.6s                                                                                    
        Index flipping: test flipping inverse                                    |    10                  10       1.3s                                                                                    
        Multiplication of isometries: test properties                            |     6                   6       4.3s                                                                                    
        Multiplication and inverse: test compatibility                           |    16                  16       5.6s                                                                                    
        Multiplication and inverse: test via CPU                                 |    40                  40      36.8s                                                                                    
        Tensor functions                                                         |     4                   4       2.3s                                                                                    
        Tensor product: test via norm preservation                               |     4                   4   37m22.2s                                                                                    
        Tensor product: test via conversion                                      |     4                   4      23.2s                                                                                    
        Tensor product: test via tensor contraction                              |     2                   2      21.7s                                                                                    
      Tensors with symmetry: (Irrep[A₄] ⊠ GroupElement[ℤ{4}, 2])                 |   402     2      1    405    1m34.3s                                                                                    
        Basic tensor properties                                                  |   150                 150       7.8s                                                                                    
        Conversion to/from host                                                  |    39                  39       1.4s                                                                                    
        Adapt                                                                    |    21                  21       2.1s                                                                                    
        Tensor Dict conversion                                                   |     6                   6       4.3s                                                                                    
        Trivial space insertion and removal                                      |   106     2           108       8.6s                                                                                    
        Tensor conversion                                                        |     8                   8       3.2s                                                                                    
        Index flipping: test flipping inverse                                    |    10                  10       2.6s                                                                                    
        Multiplication of isometries: test properties                            |     6                   6       5.2s                                                                                    
        Multiplication and inverse: test compatibility                           |    16                  16       4.8s                                                                                    
        Multiplication and inverse: test via CPU                                 |    40                  40      38.9s                                                                                    
        Tensor product: test via norm preservation                               |                  1      1      15.2s                                                                                    
      Tensors with symmetry: TensorKitSectors.IsingBimodule                      |   342     2           344    1m45.1s                                                                                    
        Basic tensor properties                                                  |   150                 150      11.1s                                                                                    
        Conversion to/from host                                                  |    39                  39       1.5s                                                                                    
        Adapt                                                                    |    21                  21       2.4s                                                                                    
        Tensor Dict conversion                                                   |     6                   6       4.5s                                                                                    
        Trivial space insertion and removal                                      |    52     2            54       6.7s                                                                                    
        Tensor conversion                                                        |     8                   8       3.1s                                                                                    
        Multiplication of isometries: test properties                            |     6                   6       6.4s                                                                                    
        Multiplication and inverse: test compatibility                           |    16                  16       8.5s                                                                                    
        Multiplication and inverse: test via CPU                                 |    40                  40      43.1s                                                                                    
        Tensor product: test via norm preservation                               |     4                   4      17.7s                                                                                    
      Tensors with symmetry: (TensorKitSectors.IsingBimodule ⊠ Irrep[A₄])        |   360     2           362    2m24.1s                                                                                    
        Basic tensor properties                                                  |   150                 150      11.9s                                                                                    
        Conversion to/from host                                                  |    39                  39       1.5s                                                                                    
        Adapt                                                                    |    21                  21       2.3s                                                                                    
        Tensor Dict conversion                                                   |     6                   6       4.4s                                                                                    
        Trivial space insertion and removal                                      |    70     2            72       6.9s                                                                                    
        Tensor conversion                                                        |     8                   8       3.1s                                                                                    
        Multiplication of isometries: test properties                            |     6                   6       6.9s             
      Tensors with symmetry: (TensorKitSectors.IsingBimodule ⊠ Irrep[A₄])        |   360     2           362    2m24.1s                                                                                    
        Basic tensor properties                                                  |   150                 150      11.9s                                                                                    
        Conversion to/from host                                                  |    39                  39       1.5s                                                                                    
        Adapt                                                                    |    21                  21       2.3s                                                                                    
        Tensor Dict conversion                                                   |     6                   6       4.4s                                                                                    
        Trivial space insertion and removal                                      |    70     2            72       6.9s                                                                                    
        Tensor conversion                                                        |     8                   8       3.1s                                                                                    
        Multiplication of isometries: test properties                            |     6                   6       6.9s                                                                                    
        Multiplication and inverse: test compatibility                           |    16                  16       9.1s                                                                                    
        Multiplication and inverse: test via CPU                                 |    40                  40      46.9s                                                                                    
        Tensor product: test via norm preservation                               |     4                   4      51.1s                                                                                    
      Deligne tensor product: test via conversion                                |    16                  16    2m26.9s  

Looks like the new A_4 tests are absolutely wrecking everything on time...
Factorizations with symmetry: (TensorKitSectors.IsingBimodule ⊠ Irrep[A₄]) | 1 1 0.8s

@kshyatt
Copy link
Copy Markdown
Member

kshyatt commented Apr 6, 2026

Additional problem is the test_dim_isapprox function which isn't present in test/setup.jl anymore...

@Jutho
Copy link
Copy Markdown
Member

Jutho commented Apr 6, 2026

Additional problem is the test_dim_isapprox function which isn't present in test/setup.jl anymore...

Oh I removed that one because it wasn't working correctly. You want to ensure that, if you use svd_trunc or eig(h)_trunc with trunc=truncrank(nvals), that the dimension of the space you obtain after truncation (dim(domain(v))) does not differ more from nvals than the quantum dimension of the sector with the largest quantum dimension that was present before the truncation (as otherwise you should have removed one more/less sector).

The old test_dim_isapprox was removed in two stages: first, I just made it into dim_isapprox and moved the @test to the actual call site, because otherwise it was very hard to figure out where the failing tests were. But then I noticed that the function didn't work, because it looked at the sectors that were present AFTER truncation, whereas the relevant quantum dimension to compare abs(dim(domain(v)) - nvals) against is the largest BEFORE truncation, so I changed this back to manual tests:

                @test abs(dim(domain(d)) - nvals)  maximum(c -> blockdim(domain(t), c), blocksectors(t); init = 1)

I thought I replaced them all, but apparently not.

@Jutho
Copy link
Copy Markdown
Member

Jutho commented Apr 6, 2026

A4Irrep is added to have GenericFusion (i.e. fusion multiplicities). It seems that in particular the "tensor product via norm preservation" test for Irrep[A₄] and (FermionParity ⊠ Irrep[A₄]) are extremely bad. Probably there is some mix going on between cpu and gpu arrays, which then fall back to some cpu routine that is scalar indexing into the gpu array.

@kshyatt
Copy link
Copy Markdown
Member

kshyatt commented Apr 6, 2026

Probably there is some mix going on between cpu and gpu arrays, which then fall back to some cpu routine that is scalar indexing into the gpu array.

If that's the case, then would it make sense to try to get #393 in before this? Or not support the GenericFusion cases (which are definitely worth having) for now, get the braiding tensor PR merged after this, then re-enable them?

Also, I am somewhat dubious of the mixed cpu-gpu explanation as that should rather throw a MethodError in many cases.

There are only 4 cases in the norm preservation situation, let me see if I can narrow down where the problem is.

@kshyatt
Copy link
Copy Markdown
Member

kshyatt commented Apr 7, 2026

@Jutho some timing is showing that, for the norm preservation case, the vast vast majority of time is spent in the tensor product step. Since this is the first time the GenericFusion path is being exercised on the GPU, I wonder if there's some painful choice there? The other difference I see is that

        @timedtestset "Tensor product: test via norm preservation" begin                                                                                                                                             
            for T in (ComplexF64, ) # Float32 case broken because of cuTENSOR                                                                                                                                        
                @time "Construction" begin                                                                                                                                                                           
                    if UnitStyle(I) isa SimpleUnit || !isempty(blocksectors(V2  V1))                                                                                                                                
                        t1 = CUDA.rand(T, V2  V3  V1, V1  V2)                                                                                                                                                     
                        t2 = CUDA.rand(T, V2  V1  V3, V1  V1)                                                                                                                                                     
                    else                                                                                                                                                                                             
                        t1 = CUDA.rand(T, V3  V4  V5, (V1  V2)')                                                                                                                                                  
                        t2 = CUDA.rand(T, (V3  V4  V5)', V1  V2)                                                                                                                                                  
                    end                                                                                                                                                                                              
                end                                                                                                                                                                                                  
                @time "Product" begin                                                                                                                                                                                
                    t = @constinferred (t1  t2)                                                                                                                                                                     
                end                                                                                                                                                                                                  
                @time "Norm" begin                                                                                                                                                                                   
                    @test norm(t)  norm(t1) * norm(t2)                                                                                                                                                              
                end                                                                                                                                                                                                  
            end                                                                                                                                                                                                      
        end                                                                                                                                                                                                          
        symmetricbraiding && @timedtestset "Tensor product: test via conversion" begin                                                                                                                               
            for T in (Float32, ComplexF64)                                                                                                                                                                           
                t1 = CUDA.rand(T, V2  V3  V1, V1)                                                                                                                                                                  
                t2 = CUDA.rand(T, V2  V1  V3, V2)                                                                                                                                                                  
                d1 = dim(codomain(t1))                                                                                                                                                                               
                d2 = dim(codomain(t2))                                                                                                                                                                               
                d3 = dim(domain(t1))                                                                                                                                                                                 
                d4 = dim(domain(t2))                                                                                                                                                                                 
                t = @constinferred (t1  t2)                                                                                                                                                                         
                At = ad(t)                                                                                                                                                                                           
                @test ad(t)  ad(t1)  ad(t2)                                                                                                                                                                        
            end                                                                                                                                                                                                      
        end                         

For the top case, we have V1 ⊗ V2 as opposed to just V1 for the second, I wonder if that's making a difference? Let me try locally and see...

@borisdevos
Copy link
Copy Markdown
Member

... for the norm preservation case, the vast vast majority of time is spent in the tensor product step.

This is something I noticed in the codecov PR, and I tried fixing with something like this. The spaces have shifted since, but it was something I saw locally already, and probably carries over to the GPU tests.

@kshyatt
Copy link
Copy Markdown
Member

kshyatt commented Apr 7, 2026

Indeed cutting the spaces a bit helped tremendously, however we're still being hit hard by the permutation tests which I will now look at. More and more I think getting the changes in #393 will help, if anyone wants to review it 🥺

@Jutho
Copy link
Copy Markdown
Member

Jutho commented Apr 7, 2026

Not sure what happened with this:

                    if UnitStyle(I) isa SimpleUnit || !isempty(blocksectors(V2  V1))                                                                                                                                
                        t1 = CUDA.rand(T, V2  V3  V1, V1  V2)                                                                                                                                                     
                        t2 = CUDA.rand(T, V2  V1  V3, V1  V1)                                                                                                                                                     
                    else                                                                                                                                                                                             
                        t1 = CUDA.rand(T, V3  V4  V5, (V1  V2)')                                                                                                                                                  
                        t2 = CUDA.rand(T, (V3  V4  V5)', V1  V2)                                                                                                                                                  
                    end 

If this is something I have inserted, it might have been an oversight from something copilot generated. I was aiming to avoid all special casing, and so the only universally valid case is the else case.

@kshyatt
Copy link
Copy Markdown
Member

kshyatt commented Apr 7, 2026

Copilot flew the tests directly into the side of the mountain! 😭

@Jutho
Copy link
Copy Markdown
Member

Jutho commented Apr 7, 2026

Oh wait, I now see the same kind of constructions exist in the CPU tests. I did try to carefully check all copilot changes, so the reason I do not remember this is probably because it was like this from the before. I mainly focussed on the factorization tests, as all the tensor tests seemed fine.

@Jutho
Copy link
Copy Markdown
Member

Jutho commented Apr 7, 2026

I'll push a commit with some smaller tests. I did not run them locally, so let's hope for the best.

@kshyatt
Copy link
Copy Markdown
Member

kshyatt commented Apr 8, 2026

Buildkite now succeeding!!!

@tensor t′[1 2 3; 4 5] := t1[1; 4] * t2[2 3; 5]
CUDA.@allowscalar begin
@tensor t′[1 2 3; 4 5] := t1[1; 4] * t2[2 3; 5]
end
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does this need an allowscalar? (just to understand what is still missing).

@Jutho
Copy link
Copy Markdown
Member

Jutho commented Apr 8, 2026

Buildkite now succeeding!!!

That is great news. The chainrules test still take quite long and time out on Windows. The tensor contraction AD test is repeated 5 times over with random contraction patterns, so that cost can easily be cut down by lowering the number of repetitions.

Also thanks to @borisdevos ; your commits contain useful improvements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants